import { Injectable } from "@angular/core";
import { Http } from "@angular/http";
import "rxjs/add/operator/map";
import { environment } from "../../environments/environment"

@Injectable()
export class ArrearsUsersService{
    arrearsUsers: string[];
    url: string;

    constructor(public http:Http) {
        this.arrearsUsers = ["crystal","22","FangNi"];
        this.url = environment.host + environment.port;
    }

    //按欠费用户编号查询(从后台获取数据)
    findByArrearsUserNo(userNo){
        return this.http.get(this.url + "/arrearsUsers/findByUserNo" + userNo)
            .map(res => res.json());
    }

    //按欠费用户姓名查询(从后台获取数据)
    findByArrearsUserName(userName){
        return this.http.get(this.url + "/arrearsUsers/findByUserName" + userName)
            .map(res => res.json());
    }
}
